#include<iostream>
using namespace std;

int main()
{
int i,n,j,x[50],y[50];
cout<<"Dati numarul de elemente ale tabloului ";cin>>n;
for(i=1;i<=n;i++)
{
cout<<"x["<<i<<"]= ";
cin>>x[i];
}
i=1;j=1;
while(i<=n)
{
y[j]=x[i];
y[j+1]=(x[i]+x[i+1])/2;
i=i+1;
j=j+2;
}
cout<<"Elementele sunt: "<<endl;
for(i=1;i<=j-2;i++) 
cout<<y[i]<<" ";
}

